package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.RepairReportDTO;
import com.eastfair.venueservice.entity.RepairReport;
import com.eastfair.venueservice.enumeration.ServiceOrderWorkOrderStatusEnum;
import com.eastfair.venueservice.vo.RepairReportVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 报修申请
 * </p>
 *
 * @author dqq
 * @date 2022 -11-21
 */
public interface RepairReportService extends SuperService<RepairReport> {

    /**
     * 查询报修申请列表VO.
     *
     * @param pageParams the page params
     * @return the list
     */
    Page<RepairReportVO> listRepairReportVO(PageParams<RepairReportDTO> pageParams);

    /**
     * 场馆查询报修申请.
     *
     * @param pageParams the page params
     * @return the list
     */
    Page<RepairReportVO> listRepairReportVOForVenue(PageParams<RepairReportDTO> pageParams);

    /**
     * 查询报修申请列表.
     *
     * @param repairReportDTO the repair report dto
     * @return the list
     */
    List<RepairReport> listRepairReport(RepairReportDTO repairReportDTO);

    /**
     * 报修单号获取报修申请.
     *
     * @param repairReportNumber the repair report number
     * @return the repair report
     */
    RepairReport getByReportRepairNumber(String repairReportNumber);

    /**
     * 报修单号获取报修申请VO.
     *
     * @param repairReportNumber the repair report number
     * @return the vo by report repair number
     */
    RepairReportVO getVOByReportRepairNumber(String repairReportNumber);

    /**
     * 保存报修申请.
     *
     * @param repairReportDTO the repair report dto
     * @return the repair report
     */
    RepairReport saveRepairReport(RepairReportDTO repairReportDTO);

    /**
     * 更新报修申请.
     *
     * @param repairReportDTO the repair report dto
     * @return the repair report
     */
    RepairReport updateRepairReport(RepairReportDTO repairReportDTO);

    /**
     * 取消报馆申请.
     *
     * @param repairReportNumber the repair report number
     * @return the boolean
     */
    boolean cancelRepairReport(String repairReportNumber);

    /**
     * 更新报修申请状态为已完成.
     *
     * @param repairReportNumber the repair report number
     * @return the boolean
     */
    boolean updateHasDispatch(String repairReportNumber);

    /**
     * 更新报修申请为已完成.
     *
     * @param repairReportDTO the repair report dto
     * @return the boolean
     */
    boolean updateFinish(RepairReportDTO repairReportDTO);

    /**
     * 更新报修的工单状态.
     *
     * @param repairReportNumber  the repair report number
     * @param workOrderStatusEnum the work order status enum
     * @return the boolean
     */
    boolean updateWorkOrderStatus(String repairReportNumber, ServiceOrderWorkOrderStatusEnum workOrderStatusEnum);

    /**
     * 更新是否预定了服务.
     *
     * @param repairReportNumber the repair report number
     * @param isBookService      the is service book 0否1是
     * @return the boolean
     */
    boolean updateIsBookService(String repairReportNumber, Integer isBookService);

    /**
     * 发送报修申请的站内信.
     *
     * @param repairReport the repair report
     * @return the boolean
     */
    boolean sendReportInnerMsg(RepairReport repairReport);

    /**
     * 异步发送报修申请的站内信.
     *
     * @param repairReport the repair report
     * @return the boolean
     */
    void asyncSendReportInnerMsg(RepairReport repairReport);
}
